/**
 * @param {number[][]} points
 * @return {number}
 */
var findMinArrowShots = function(points) {
  let count = 0, maxNum = -(2 ** 31) - 1;
  points = points.sort((a, b) => a[1] - b[1]);
  for(let i = 0; i < points.length; i++) {
    if(points[i][0] > maxNum) {
      count++;
      maxNum = points[i][1];
    }
  }
  return count;
};
let points = [[10,16],[2,8],[1,6],[7,12]];
console.log(findMinArrowShots(points));
points = [[1,2],[3,4],[5,6],[7,8]];
console.log(findMinArrowShots(points));
points = [[1,2],[2,3],[3,4],[4,5]];
console.log(findMinArrowShots(points));
points = [[-2147483648,2147483647]];
console.log(findMinArrowShots(points));
